package com.test.springboot.springBootUtils.service.shell;

import com.test.springboot.springBootUtils.bean.Person;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;
import org.springframework.shell.standard.ShellOption;

@ShellComponent
public class PeopleCommands {
    private final ConsoleService console;

    public PeopleCommands(ConsoleService console) {
        this.console = console;
    }

    @ShellMethod("interact with the directory")
    public void diresctory(@ShellOption(valueProvider = PersonValueProvider.class)Person person) {
        this.console.write("working with %s", person.getName());
    }
}
